<html>
<head><meta charset="utf-8"><title>Wasm plugins · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html">Wasm plugins</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="239788128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239788128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DevinR528 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239788128">(May 21 2021 at 17:45)</a>:</h4>
<p>Hey, I'm a Google Summer of Code student working on <a href="https://summerofcode.withgoogle.com/projects/#4595135830032384">Ruma's automated checks</a>. My mentor forwarded me <a href="https://www.reddit.com/r/rust/comments/nh337j/write_rust_lints_without_forking_clippy/gyv3qce/?utm_source=reddit&amp;utm_medium=web2x&amp;context=3">matklad's redit comment</a> about a possible utopian future where one could "easily" write plugins for R-A using wasm. If anyone would be interested in expanding on this there might be a chance for some cross pollination?!</p>



<a name="239789504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239789504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239789504">(May 21 2021 at 17:57)</a>:</h4>
<p>well, the main problem would be exposing all of the APIs one would need to write a check or assist, presumably even in a stable way (we are still evolving the APIs a lot, they are very much not stable)</p>



<a name="239789546"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239789546" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239789546">(May 21 2021 at 17:57)</a>:</h4>
<p>the rest (loading some wasm, executing it) is probably comparably trivial</p>



<a name="239789681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239789681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239789681">(May 21 2021 at 17:58)</a>:</h4>
<p>I don't know how easy current wasm engines make exposing APIs from Rust, admittedly</p>



<a name="239790150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239790150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239790150">(May 21 2021 at 18:01)</a>:</h4>
<p>one application that would also benefit normal r-a usage would be WASM proc macros, but that seems fairly unrelated to allowing arbitrary assist and diagnostic plugins</p>



<a name="239791379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239791379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DevinR528 <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239791379">(May 21 2021 at 18:11)</a>:</h4>
<p>When you say "exposing APIs from Rust do you mean <a href="https://github.com/zellij-org/zellij/blob/main/zellij-server/src/wasm_vm.rs">this direction</a>? So it would be up to RA to deal with running the wasm? </p>
<p>Will it be helpful for me to occasionally let you know how the tool is coming, giving everyone an idea of what the exports might be? Maybe help with a public API when the RA crates are used outside RA.</p>
<p>Are the WASM proc-macros about sandboxing or is this something specific?</p>



<a name="239791675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239791675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239791675">(May 21 2021 at 18:13)</a>:</h4>
<blockquote>
<p>When you say "exposing APIs from Rust do you mean this direction? So it would be up to RA to deal with running the wasm?</p>
</blockquote>
<p>yes</p>



<a name="239792286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239792286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239792286">(May 21 2021 at 18:18)</a>:</h4>
<blockquote>
<p>Are the WASM proc-macros about sandboxing or is this something specific?</p>
</blockquote>
<p>I was more thinking about improving reliability – we currently run them in a separate process, and when that crashes we just stop expanding them. With WASM we could retry the execution much easier.</p>



<a name="239792336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Wasm%20plugins/near/239792336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Wasm.20plugins.html#239792336">(May 21 2021 at 18:19)</a>:</h4>
<p>Sandboxing is also useful of course</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>